﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Drawing;
#pragma warning disable 0618
namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for TBodyTest and is intended
    ///to contain all TBodyTest Unit Tests
    ///</summary>
    [TestClass()]
    public class TBodyTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for TBody Constructor
        ///</summary>
        [TestMethod()]
        public void TBodyConstructorTest() {
            TBody target = new TBody();
            Assert.AreEqual("<tbody></tbody>", target.ToString());
        }

        /// <summary>
        ///A test for Align
        ///</summary>
        [TestMethod()]
        public void AlignTest() {
            TBody target = new TBody();
            Nullable<CellHorizontalAlignment> expected = CellHorizontalAlignment.Center;
            Nullable<CellHorizontalAlignment> actual;
            target.Align = expected;
            actual = target.Align;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for BGColor
        ///</summary>
        [TestMethod()]
        public void BGColorTest() {
            TBody target = new TBody();
            Nullable<Color> expected = Color.Red;
            Nullable<Color> actual;
            target.BGColor = expected;
            actual = target.BGColor;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Char
        ///</summary>
        [TestMethod()]
        public void CharTest() {
            TBody target = new TBody();
            Nullable<char> expected = ' ';
            Nullable<char> actual;
            target.Char = expected;
            actual = target.Char;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for CharOff
        ///</summary>
        [TestMethod()]
        public void CharOffTest() {
            TBody target = new TBody();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.CharOff = expected;
            actual = target.CharOff;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for VAlign
        ///</summary>
        [TestMethod()]
        public void VAlignTest() {
            TBody target = new TBody();
            Nullable<CellVerticalAlignment> expected = CellVerticalAlignment.Baseline;
            Nullable<CellVerticalAlignment> actual;
            target.VAlign = expected;
            actual = target.VAlign;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            TBody t = new TBody();
            t.Align = CellHorizontalAlignment.@Char;
            t.BGColor = Color.Red;
            t.Char = 'a';
            t.CharOff = 1;
            t.VAlign = CellVerticalAlignment.Baseline;
            Assert.AreEqual("<tbody align=\"char\" " +
                "bgcolor=\"#FF0000\" " +
                "char=\"a\" " +
                "charoff=\"1\" " +
                "valign=\"baseline\"></tbody>", t.ToString());
        }
    }
}
